import os
import time

# 假设你的操作系统是Windows
desktop_path = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop')
file_name = '徐光宗.txt'
file_path = os.path.join(desktop_path, file_name)

# 获取文件的创建时间
creation_time = os.path.getctime(file_path)
# 将时间戳转换为本地时间
local_creation_time = time.ctime(creation_time)

# 获取文件的修改时间
modification_time = os.path.getmtime(file_path)
# 将时间戳转换为本地时间
local_modification_time = time.ctime(modification_time)

print(f"文件创建时间: {local_creation_time}")
print(f"文件修改时间: {local_modification_time}") 